package org.thread.test06.ts.demo05.t01;

import java.util.Random;

/**
 *
 * 水果 - 给女孩提供各种类型的水果
 * @author CSY
 * @date 2025 - 03 - 14
 */
public class Fruit {
    /**
     * 希望给女孩的水果品类 - 随机给出
     */
    private String[] fruitArray = {"苹果","雪梨","香蕉","草莓","李子"};
    /**
     * 存储数组的随机的下表索引
     */
    private int index;
    public Fruit(){
        index = new Random().nextInt(fruitArray.length);
    }

    @Override
    public String toString() {
        return fruitArray[index];
    }
}
